package com.cqkjxy.controller;

import com.cqkjxy.commons.constants.CommonConstants;
import com.cqkjxy.entity.ScoringDetailEntity;
import com.cqkjxy.service.ScoringService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class ScoreController {

    @Autowired
    private ScoringService scoringService;

    @RequestMapping("/score_detail_tech_innov")
    public String toContent() {
        return "pages/score/score_content";
    }

    @RequestMapping("/score_list")
    public String getScoreDetial(@RequestParam(defaultValue = "1") int page, Model model) {
        Page<ScoringDetailEntity> list = scoringService.findList(page-1, CommonConstants.PAGE_SIZE);
        model.addAttribute("scorePage", list);
        return "pages/score/score_list";
    }
}
